﻿// ===============================================================================
// XCI.NET 西安交通信息WinForm开发框架 2018 版权所有
// ===============================================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XCI.Core;

namespace XCI.Core
{
    public class JsonMessage
    {
        /// <summary>
        /// 初始化Json消息
        /// </summary>
        public JsonMessage()
        {

        }

        /// <summary>
        /// 初始化Json消息
        /// </summary>
        /// <param name="success">是否成功</param>
        public JsonMessage(bool success)
        {
            this.success = success;
        }

        /// <summary>
        /// 初始化Json消息
        /// </summary>
        /// <param name="success">是否成功</param>
        /// <param name="msg">消息</param>
        public JsonMessage(bool success, string msg)
        {
            this.success = success;
            this.msg = msg;
        }

        /// <summary>
        /// 初始化Json消息
        /// </summary>
        /// <param name="success">是否成功</param>
        /// <param name="data">数据对象</param>
        public JsonMessage(bool success, object data)
        {
            this.success = success;
            this.data = data;
        }

        /// <summary>
        /// 初始化Json消息
        /// </summary>
        /// <param name="data">数据对象</param>
        public JsonMessage(object data)
        {
            this.success = true;
            this.data = data;
        }

        /// <summary>
        /// 初始化Json消息
        /// </summary>
        /// <param name="boolMessage">指定的布尔消息</param>
        public JsonMessage(BoolMessage boolMessage)
        {
            this.success = boolMessage.Success;
            this.msg = boolMessage.Msg;
        }

        /// <summary>
        /// 是否成功
        /// </summary>
        public bool success { get; set; }

        /// <summary>
        /// 消息
        /// </summary>
        public string msg { get; set; }

        /// <summary>
        /// 数据对象
        /// </summary>
        public object data { get; set; }
    }
}
